package backend;

public class Course {
  public final String courseName;
  public final String courseId; // e.g. 236369.
  public final String lecturerInCharge;
  public final String moedA;
  public final String moedB;
  public final String description;
  public final String creditPoints;
  public final int capacity;
  public final Iterable<Session> lectures;
  public final Iterable<Session> tutorials;
  public final int groupNum;
  public final String owner;
  
  public Course(final String _courseName, final String _courseId, final String _lecturerInCharge,
      final String _moedA, final String _moedB, final String _description, final String _creditPoints,
      final int _capacity, final Iterable<Session> _lectures, final Iterable<Session> _tutorials,
      final int _groupNum, final String _owner) {
    courseName = _courseName;
    courseId = _courseId;
    lecturerInCharge = _lecturerInCharge;
    moedA = _moedA;
    moedB = _moedB;
    description = _description;
    creditPoints = _creditPoints;
    capacity = _capacity;
    lectures = _lectures;
    tutorials = _tutorials;
    groupNum = _groupNum;
    owner = _owner;
  }
  
  @Override public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + (courseName == null ? 0 : courseName.hashCode());
    return result;
  }
  
  @Override public boolean equals(final Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    final Course other = (Course) obj;
    if (courseName == null) {
      if (other.courseName != null)
        return false;
    } else if (!courseName.equals(other.courseName))
      return false;
    return true;
  }
}
